

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class TestEmplyee
{
    private Employee employee1;
    private Employee employee2;
    private Contrat contrat1;
    private Contrat contrat2;

    public TestEmplyee()
    {
    }
   
    @Before
    public void setUp()
    {
    	contrat1 = new Contrat("CDD");
    	employee1= new Employee("Durand",contrat1);
    	employee2= new Employee("Durand",contrat1);
    }

    
    @After
    public void tearDown()
    {
    }

    @Test
    public void testNomEmployee(){
    	employee1.setNom(null);
    	assertEquals("Durand", employee1.getNom());
    	
    }
    
    @Test
    public void testSecuEmployee(){
    	employee1.setNumeroSecu(87);
    	assertEquals(100, employee1.getNumeroSecu());
    	
    }
    
    @Test
    public void testOldContratEmployee(){
    	contrat2 = new Contrat ("CDI");
    	employee1.setContrat(contrat2);
    	assertEquals(1, employee1.getOldContrats().size());
    	
    }
    
    @Test
    public void testTotalSalaire(){
    	contrat2 = new Contrat ("CDD");
    	employee1.setContrat(contrat2);
    	assertEquals(1, employee1.getOldContrats().size());
    	
    }
    
}

